import java.util.*;

public class Weather {
    public static void main(String[] args) {
        final int NUM_OF_DAYS = 10;
        final int NUM_OF_HOURS = 24;
        double[][][] data = new double[NUM_OF_DAYS][NUM_OF_HOURS][2];
        
        Scanner scan = new Scanner(System.in);
        for (int i = 0; i < NUM_OF_DAYS * NUM_OF_HOURS; i++) {
            int day = scan.nextInt();
            int hour = scan.nextInt();
            double temperature = scan.nextDouble();
            double humidity = scan.nextDouble();
            data[day - 1][hour - 1][0] = temperature;
            data[day - 1][hour - 1][1] = humidity;
        }
        
        for (int i = 0; i < NUM_OF_DAYS; i++) {
            double dailyTemperatureTotal = 0, dailyHumidityTotal = 0;
            for (int j = 0; j < NUM_OF_HOURS; j++) {
                dailyTemperatureTotal += data[i][j][0];
                dailyHumidityTotal += data[i][j][1];
            }
            
            System.out.println("Dienas " + i + " vidējaa temperatūra ir "
                    + dailyTemperatureTotal / NUM_OF_HOURS);
            System.out.println("Dienas " + i + " vidējais mitrums ir "
                    + dailyHumidityTotal / NUM_OF_HOURS);
        }
    }
}